<#assign base=request.contextPath />
<!DOCTYPE html>
<div class="row">
	<div class="col-md-12 col-sm-12 col-xs-12">
		<div class="x_panel">
			<div class="x_title">
				<h2>资讯编辑 <small></small></h2>
				<div class="clearfix"></div>
			</div>
			<div class="x_content">
				<br/>
				<form id="postForm" data-parsley-validate class="form-horizontal form-label-left" method="post" action="${base}/gx/products/save" enctype="multipart/form-data"
				>
					<input type="hidden" id="id" name="id" value="${((obj.id)?c)!0 }">
					  <input type="hidden" name="isDelete" value="${((obj.isDelete)?c)!0 }">
		            <input type="hidden" name="addTime" value="${(obj.addTime)!.now?string['yyyy-MM-dd HH:mm:ss']}">
		            <input type="hidden" name="updateTime" value="${.now?string['yyyy-MM-dd HH:mm:ss']}">
		            <input type="hidden" name="addName" value="${(obj.addName)!admin.userName}">
		            <input type="hidden" name="clickMun" value="${((obj.clickMun)?c)!0 }">
		           
					<div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">产品名称<span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                        	<input type="text" id="productsName" name="productsName" value="${(obj.productsName)!''}" class="form-control col-md-7 col-xs-12">
                        </div>
					</div>

					<div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">产品类型 <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                        	<select id="productsType" name="productsType" class="form-control select2">
                        		<option value="">请选择</option>
	         					<option value="1">水果</option>
		                        <option value="2">家禽</option>
		                        <option value="3">农作物</option>
		                        <option value="4">水产</option>
		                        <option value="5">其他</option>
	                    	</select>
                        </div>
					</div>

					
					<label class="control-label col-md-3 col-sm-3 col-xs-12 " id="meijing" for="first-name ">
							产品图片： <span class="required">*</span>
                        </label>
					<div class="img-box full">
					
						<section class=" img-section">
							<div class="z_photo upimg-div clear" >
									 <section  class="z_file fl section">
										<img src="${base}/static/images/a11.png" class="add-img">
										<input type="file" name="file1"  id="file1" class="file1" value="" accept="image/jpg,image/jpeg,image/png,image/bmp" multiple />
									 <input type="hidden" images="${(obj.productsImg)!''}" imagePath="${imagePath}" name="productsImg" id="productsImg">
									 </section>
							 </div>
						</section>
					</div>
					<aside class="mask works-mask">
						<div class="mask-content">
							<p class="del-p ">您确定要删除作品图片吗？</p>
							<p class="check-p"><span class="del-com wsdel-ok">确定</span><span class="wsdel-no">取消</span></p>
						</div>
					</aside>

					<div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">产品单价 <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                        	<input type="text" id="price" name="price" value="${(obj.price)!''}" class="form-control col-md-7 col-xs-12">
                        </div>
					</div>
					
					<div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">储藏方式<span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                        	<select id="storageMode" name="storageMode" class="form-control select2">
                        		<option value="">请选择</option>
	         					<option value="1">冷藏</option>
		                        <option value="2">真空</option>
	                    	</select>
                        </div>
					</div>
					
					<div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">包装方式<span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                        	<select id="proPackage" name="proPackage" class="form-control select2">
                        		<option value="">请选择</option>
	         					<option value="1">纸箱</option>
		                        <option value="2">木箱</option>
		                        <option value="3">塑料袋</option>
	                    	</select>
                        </div>
					</div>
					
					<div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name"> 商户名称<span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                        	<input type="text" id="merchantName" name="merchantName" value="${(obj.merchantName)!''}" class="form-control col-md-7 col-xs-12">
                        </div>
					</div>
					
					<div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name"> 商户人<span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                        	<input type="text" id="businessman" name="businessman" value="${(obj.businessman)!''}" class="form-control col-md-7 col-xs-12">
                        </div>
					</div>
					
					<div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name"> 商户地址<span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                        	<input type="text" id="storeAddress" name="storeAddress" value="${(obj.storeAddress)!''}" class="form-control col-md-7 col-xs-12">
                        </div>
					</div>
					
					<div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name"> 产品销量<span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                        	<input type="text" id="proVolume" name="proVolume" value="${(obj.proVolume)!''}" class="form-control col-md-7 col-xs-12">
                        </div>
					</div>
						<div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name"> 联系方式<span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                        	<input type="text" id="proContact" name="proContact" value="${(obj.proContact)!''}" class="form-control col-md-7 col-xs-12">
                        </div>
					</div>
					
					
					<div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">产品介绍 <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                        	<div id="content_summernote" class="summernote" >
                                        ${(obj.proContent)!''}
                        	</div>
                            <input type="hidden" name="proContent" id="proContent">
                        </div>
					</div>
					
					
					<div class="ln_solid"></div>
					<div class="form-group">
						<div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
							<button type="button" class="btn btn-success" id="submit">保存</button>
							<button type="button" class="btn btn-primary" id="goBack">返回</button>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>
 <script src="${base}/static/vendors/someupload/sysproduct.js"></script>
<script type="text/javascript">
window.formdata=new FormData();
var filess= $("#postForm");

var base='${base}';
		var imgs=$(".upload-ul .diyControl img")
		console.log(imgs)
	 var idmsg='';
$(function() {
   showimg();
		//showimgsbacj()
	//select2
	$(".select2").select2({width: "100%"});
	$('.summernote').summernote({
        height: 350, // set editor height
        minHeight: null, // set minimum height of editor
        maxHeight: null, // set maximum height of editor
        focus: false, // set focus to editable area after initializing summernote
        lang: 'zh-CN',
        shortcuts:false //禁止使用快捷键
    });
	     		     //多图上传
					var $tgaUpload1 = $('#goodsUpload').diyUpload({
					    url: '${base}/gx/products/save',
					    success: function(data) {},
					    error: function(err) {},
					    buttonText: '',
					    accept: {
					        title: "Images",
					        extensions: 'gif,jpg,jpeg,bmp,png'
					    },
					    thumb: {
					        width: 120,
					        height: 90,
					        quality: 100,
					        allowMagnify: true,
					        crop: true,
					        type: "image/jpeg"
					    }
					});

	$("#goBack").click(function() {
		$("#main_content").load('${base}/gx/products/list');	        
    });
	
	
});
</script>